package kr.hyunist.androidcomplete01saeildamil.ch09;

import kr.hyunist.androidcomplete01saeildamil.*;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;

public class OptionMenuTest2 extends Activity {
	TextView tv;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		tv = new TextView(this);
		tv.setText("메뉴를 클릭!");
		setContentView(tv);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);

		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.onclickmenu, menu);

		return true;
	}

	public void mOnClick(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.onclickabout:
			tv.setText("프로그램 소개가 선택되었음!");
			break;
			
		case R.id.onclickhelp:
			tv.setText("도움말이 선택되었음!");
			break;
		}
	}
}
